<template>
  <div>
    <el-container style="height: 700px; border: 1px solid #eee">
      <el-header style="font-size:40px;background-color: rgb(238, 241, 246)" >talis智能学习辅助系统</el-header>
      <el-container>
        <el-aside width="250px" style="border: 1px solid #eee">
            <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1', '3']">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-message"></i>系统信息管理</template>
              <el-menu-item index="1-1">
                <router-link to="/dept" >部门管理</router-link>
              </el-menu-item>

              <el-menu-item index="1-2">
                 <router-link to="/emp" >员工管理</router-link>
              </el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
        </el-aside>


        <el-main>
            <el-table :data="tableData" border >
                <el-table-column prop="id" label="ID" width="140" align="center"></el-table-column>
            <el-table-column prop="name" label="科室" width="180" align="center">
            </el-table-column>
            <!-- <el-table-column prop="chief" label="负责人" width="180" align="center">
            </el-table-column> -->
            <!-- <el-table-column prop="people" label="成员" width="180" align="center">
            </el-table-column> -->
              <el-table-column prop="createTime" label="创建时间" width="230" align="center">
              </el-table-column>
              <el-table-column prop="updateTime" label="最后操作时间" width="230" align="center">
              </el-table-column>
              <el-table-column label="操作" align="center">
                <el-button type="primary" size="mini">编辑</el-button>
                <el-button type="danger" size="mini">删除</el-button>
            </el-table-column>
            </el-table>
            <br>
            <el-pagination 
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            background layout="sizes,prev, pager, next,jumper,total" :total=counts>
            </el-pagination>  
      
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>



<script>
import axios from 'axios';
export default {
  methods: {
  
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex === 1) {
        return "warning-row";
      } else if (rowIndex === 3) {
        return "success-row";
      }
      row;
      return "";
    },
    handleSizeChange(val) {
        alert("每页记录数变化"+val);
      },
      handleCurrentChange(val) {
       alert("页码发生变化:"+val);

      },
    
  },

  data() {
    return { tableData:[] ,
      counts :1000,
      }

  },

  mounted() {
        //alert("页面加载开始");
         axios.get("http://192.168.138.101/Api/depts").then((result)=>{
            this.tableData=result.data.data;
         })
        // alert("页面加载完成");
    
      }
};

</script>

